package com.etc;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @Auther: zhezhe
 * @Date: 2018/10/2511:49
 * @Description:
 */
public class DataSortReduce extends Reducer<IntWritable,IntWritable,IntWritable,IntWritable> {
    private IntWritable linenum = new IntWritable(1);
    @Override
    protected void reduce(IntWritable key, Iterable<IntWritable> values, Context context) throws
            IOException, InterruptedException {
        for (IntWritable value : values) {
            context.write(linenum,key);
            linenum = new IntWritable(linenum.get()+1);
        }
    }
}
